<?php
/**
 * User: fwj
 * Date: 2018/6/14
 * Time: 9:14
 */

namespace app\index\model;


use think\Model;

class Grade extends Model
{
//    //开启自动时间戳
//    protected $autoWriteTimestamp = true;
    //关联teacher
    public function teacher()
    {
        return $this->hasOne('Teacher');
    }
    //关联student
    public function student()
    {
        return $this->hasMany('Student');
    }
    //status字段返回值处理
//    public function getStatusAttr($value)
//    {
//        $status = [
//            0 => '已停用',
//            1 => '已启用'
//        ];
//        return $status[$value];
//    }
}